import request from '@/utils/request'
export interface FormDto {
    id?: number
    name: string|null
    formContent?: string|null
    createTime?: string
    updateTime?: string
    createBy?: number
    updateBy?: number
    remark?: string|null
  }

/* 查询表单列表 */
export const getFormList = (params: any) => {
  return request({
    url: '/flowable/form/list',
    method: 'get',
    params
  })
}

/* 获取表单详情 */
export const getFormDetail = (id: number) => {
  return request({
    url: `/flowable/form/${id}`,
    method: 'get'
  })
}

/* 新增表单 */
export const addForm = (data: FormDto) => {
  return request({
    url: '/flowable/form',
    method: 'post',
    data
  })
}

/* 修改表单 */
export const updateForm = (data: FormDto) => {
  return request({
    url: '/flowable/form',
    method: 'put',
    data
  })
}

/* 删除表单 */
export const deleteForm = (ids: number[]) => {
  return request({
    url: `/flowable/form/${ids.join(',')}`,
    method: 'delete'
  })
}

/* 校验表单名称唯一性 */
export const checkFormNameUnique = (name: string) => {
  return request<boolean>({
    url: '/flowable/form/checkNameUnique',
    method: 'get',
    params: { name }
  })
}

